# 字符串常用函数

samp_string='Whatever you are, be a good one.'

# print the first character
print(samp_string[0])
# print the last character
print(samp_string[-1])
# get the whole string
print(samp_string[:])
# start end step
print(samp_string[:-1:])

#resever the string
print(samp_string[::-1])


url="http://pythonabc.org"

print(url[:-3])
print(url[-3:])

print(url[7:])
print(url[7:-4])

############################

for ch in samp_string:
    print(ch,end="")
print("wwwwwwwwwwww")

for i in range(0,len(samp_string)-1,2):
    print(samp_string[i]+samp_string[i+1],end="")
# 避免直接字符串相加 使用join
print("----")
print(samp_string.lower())
print(samp_string.upper())
print(samp_string.capalitze())

'''

islower()
isupper()
#return True if character is letter or numbers
isalnum
#return True if character is letter
isalpha
#return True if character is number(float are False)
isaldigit

isspace
'''

